<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>我的播放</title>
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
	<link rel="icon" type="image/png" href="imgs/logo.png">
	<link href="css/mui.css" rel="stylesheet"/>
	<link href="css/mui-icons-extra.css" rel="stylesheet"/>
	<style type="text/css">
		body { margin: 0; padding: 0; }
		#nodata { margin-top:50%; font-size:20px; text-align:center; float:none; }
		/* 右下角菜单 */
		.app-v-menu { position: fixed; bottom: 100px; right: 10px; z-index: 100; }
		.app-v-btn div { padding:2px 5px; font-size: 14px; }
		.app-v-btn span { color: #FFF; font-size: 30px;
			text-shadow: 1px 1px 3px black; }
		.app-v-btn .app-txt { padding-right: 10px;
			width: 40px; color: red; text-align: center; font-weight: bolder;
			text-shadow: 1px 1px 5px black;  }
		.app-v-btn .app-txt2 { padding-right: 10px;
			width: 40px; color: #FFF; text-align: center; font-weight: bolder;
			text-shadow: 1px 1px 5px black;  }
		/*#btn { width: 100%; position: fixed; z-index: 10000; top: 0; }*/
		/*#btn button { width: 50%; border: 0; border-radius: 0; }*/
	</style>
</head>
<body>
	<!-- 主体布局 -->
	<div id="refresh">
		<p id="nodata">正在获取...</p>
	</div>
	<!-- 主体布局 -->
</body>
</html>


<script src="js/mui.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/app.js"></script>
<script type="text/javascript">
	var cw = document.documentElement.clientWidth; //屏幕宽度
	var ch = document.documentElement.clientHeight; //屏幕高度
	var id = getUrlParam('id');
	//自动加载
	(function($, owner) {
		getOne();
	}(mui, window.app = {}));
	//获取数据
	function getOne(){
		var formData = { id:id };
		mui.ajax(domain+'/same/temp/one', {
			type:'post',
			data:formData,
			dataType:'json',
			timeout:timeout,
			headers:headers,
			success:function(res){
				console.log(res);
				if (res.code!=0) {
					mui("#refresh")[0].innerHTML = '<p id="nodata">没有数据</p>';
					return
				}
				mui("#refresh")[0].innerHTML = showOne(res.data);
			},
			error:function(){
				mui.toast('网络错误！');
			}
		});
	}
	//显示
	function showOne(v){
		var h = '';
		var id = v.id, dn = v.dn;
		var cover = v.cover;
		var link = v.link;
		cover = cover ? dn+cover : 'imgs/tmp.png';
		link = link ? dn+link : 'imgs/tmp.png';
		h += '<div style="width:'+cw+'px;height:'+ch+'px;">';
		h += '<video poster="'+cover+'" type="video/mp4" name="media" width="'+cw+'" height="'+ch+'" controls="controls" autoplay="autoplay" loop><source src="'+link+'" type="video/mp4"></video>';
		h += '</div>';
//		h += '<div id="btn"><button>返回</button><button>同款</button></div>';
		h += '<div class="app-v-menu app-v-btn">';
		h += '<span class="mui-icon mui-icon-undo" onclick="history.go(-1)"></span>';
		h += '<p class="app-txt2" onclick="history.go(-1)">返回</p>';
		h += '<div style="height:10px;"></div>';
		h += '<span class="mui-icon-extra mui-icon-extra-class app-txt"></span>';
		h += '<p class="app-txt">同款</p>';
		h += '</div>';
		return h;
	}
</script>